<template>
  <el-table :data="dataList" border>
    <el-table-column prop="transactionType" label="事务处理类型" width="100" fixed="left" />
    <el-table-column prop="sourceCode" label="来源" />


    <el-table-column prop="organizationCode" label="库房组织" width="100" />
    <el-table-column prop="subinventoryCode" label="子库房" width="100" />
    <el-table-column prop="itemCode" label="物料代码" />

    <el-table-column prop="itemDesc" label="物料描述" />
    <el-table-column prop="transactionQty" label="数量" width="100" />
    <el-table-column prop="unitMeasLookupCode" label="物料单位" />

    <el-table-column prop="unitPrice" label="采购单价" width="100" />
    <el-table-column prop="poOrderNumber" label="采购订单号" width="100" />

    <el-table-column prop="transactionProcessTime" label="事务处理时间" width="120">
      <template v-slot="scope">
        <span>{{ timeFormat(scope.row.transactionProcessTime, 'y2s') }}</span>
      </template>
    </el-table-column>
    <el-table-column fixed="right" label="操作" width="150">
      <template v-slot="scope">
        <el-button type="success" size="small" @click="showJournalList(scope.row.businessId)">查看分录信息</el-button>
      </template>
    </el-table-column>

  </el-table>
</template>

<script lang="ts" setup>
import { CostTransactionProcess } from "@/requests/request";
import { timeFormat } from "@/utils/time"

defineProps({
  dataList: Array<CostTransactionProcess>
});


const showJournalList = (businessId: string) => {
  emit('showJournalList', businessId);
}

const emit = defineEmits(['showJournalList'])
</script>
<style lang="scss" scoped></style>